Skip to content

Replace the in-tree libc with the external copy #29546

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Nov 10, 2015

Conversation

alexcrichton
Copy link
Member

This commit replaces the in-tree liblibc with the external clone which has no evolved beyond the in-tree version in light of its recent redesign.

The primary changes here are:

  • src/liblibc/lib.rs was deleted
  • src/liblibc is now a submodule pointing at the external repository
  • src/libstd/sys/unix/{c.rs,sync.rs} were both deleted having all bindings folded into the external liblibc.
  • Many ad-hoc extern blocks in the standard library were removed in favor of bindings now being in the external liblibc.
  • Many functions/types were added to src/libstd/sys/windows/c.rs, and the scattered definitions throughout the standard library were consolidated here.

At the API level this commit is not a breaking change, although it is only very lightly tested on the *BSD variants and is probably going to break almost all of their builds! Follow-up commits to liblibc should in theory be all that's necessary to get the build working on the *BSDs again.

@rust-highfive
Copy link
Contributor

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

cc @dhuseby, @semarie, @mneumann -- this is likely to break BSD builds, but if you want to test out I'd be more than willing to fix things up before it lands!

cc @rust-lang/libs -- fallout from the libc transition, especially on the Windows side of thing

r? @brson

@brson
Copy link
Contributor

brson commented Nov 3, 2015

r=me

@brson brson added the relnotes Marks issues that should be documented in the release notes of the next release. label Nov 3, 2015
@brson
Copy link
Contributor

brson commented Nov 3, 2015

Tagging this with relnotes to remind myself to mention the libc rewrite in the notes.

@alexcrichton alexcrichton force-pushed the new-libc branch 8 times, most recently from f08e189 to fafb135 Compare November 4, 2015 01:56
@semarie
Copy link
Contributor

semarie commented Nov 4, 2015

@alexcrichton thanks to cc me

yes, it seems to break openbsd, but it seems related to new-libc code. I will take a look.

@semarie
Copy link
Contributor

semarie commented Nov 4, 2015

I have made a PR for make openbsd (and bitrig, I hope) be able to build libc rust-lang/libc#39

But I still have a weird error while trying to build rustc with my PR (stop in stage1 libstd building):

../src/libstd/lib.rs:268:12: 268:25 error: unused or unknown feature, #[deny(unused_features)] on by default
../src/libstd/lib.rs:268 #![feature(drop_in_place)]

whereas a version with "plain" liblibc build fine.

#![allow(unused_attributes)]
#![cfg_attr(stage0, allow(unused_features))]
#![cfg_attr(stage0, allow(unused_attributes))]
#![cfg_attr(stage0, allow(improper_ctypes))]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexcrichton why this ? it breaks at least the openbsd build.

src/libstd/lib.rs has drop_in_place feature, but it used only on some targets. So removing unused_attributes will break stage1/stage2 for others.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I'll look into fixing, I'm not a huge fan of allowing lints like this which are intentionally here to help clean up some code!

@alexcrichton alexcrichton force-pushed the new-libc branch 2 times, most recently from 586481d to c30a40d Compare November 4, 2015 21:30
@alexcrichton
Copy link
Member Author

@bors: r=brson c30a40d

@bors
Copy link
Collaborator

bors commented Nov 4, 2015

⌛ Testing commit c30a40d with merge 4c0cd18...

@bors
Copy link
Collaborator

bors commented Nov 4, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member Author

@bors: r=brson 29ddae2

@bors
Copy link
Collaborator

bors commented Nov 4, 2015

⌛ Testing commit 29ddae2 with merge 8ace105...

@bors
Copy link
Collaborator

bors commented Nov 9, 2015

💔 Test failed - auto-linux-musl-64-opt

@alexcrichton
Copy link
Member Author

@bors: r=brson 615c345

@bors
Copy link
Collaborator

bors commented Nov 9, 2015

⌛ Testing commit 615c345 with merge 7612930...

@bors
Copy link
Collaborator

bors commented Nov 9, 2015

💔 Test failed - auto-linux-cross-opt

@alexcrichton
Copy link
Member Author

@bors: r=brson 9da29e0813aa051b15cfd97874bd163ee52ac859

@bors
Copy link
Collaborator

bors commented Nov 10, 2015

⌛ Testing commit 9da29e0 with merge 31ae76d...

@bors
Copy link
Collaborator

bors commented Nov 10, 2015

💔 Test failed - auto-linux-64-x-android-t

* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
* Update all references to use `libc` as a result.
* Update all references to the new flat namespace.
* Moves all windows bindings into sys::c
@alexcrichton
Copy link
Member Author

@bors: r=brson 3d28b8b

bors added a commit that referenced this pull request Nov 10, 2015
This commit replaces the in-tree liblibc with the [external clone](https://github.com/rust-lang-nursery/libc) which has no evolved beyond the in-tree version in light of its [recent redesign](rust-lang/rfcs#1291).

The primary changes here are:

* `src/liblibc/lib.rs` was deleted
* `src/liblibc` is now a submodule pointing at the external repository
* `src/libstd/sys/unix/{c.rs,sync.rs}` were both deleted having all bindings folded into the external liblibc.
* Many ad-hoc `extern` blocks in the standard library were removed in favor of bindings now being in the external liblibc.
* Many functions/types were added to `src/libstd/sys/windows/c.rs`, and the scattered definitions throughout the standard library were consolidated here.

At the API level this commit is **not a breaking change**, although it is only very lightly tested on the *BSD variants and is probably going to break almost all of their builds! Follow-up commits to liblibc should in theory be all that's necessary to get the build working on the *BSDs again.
@bors
Copy link
Collaborator

bors commented Nov 10, 2015

⌛ Testing commit 3d28b8b with merge 6aee7c5...

@dhuseby
Copy link

dhuseby commented Nov 11, 2015

I've been in London at MozFest. I'm trying to catch up now.

@mneumann
Copy link
Contributor

@dhuseby : One thing you have to fix for FreeBSD is to define SIGSTKSZ. I did it for DragonFly (rust-lang/libc#60), but didn't know the exact value for FreeBSD.

@dhuseby
Copy link

dhuseby commented Dec 30, 2015

@mneumann thanks, i believe it's fixed now.

@alexcrichton alexcrichton deleted the new-libc branch January 21, 2016 01:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants